{{extend './layout.htm'}}

{{block 'header'}}
        <div class="container jumbotron">
            <h1>{{article.title}}</h1>
            <p>时间: {{article.add_time | dateFormat 'YYYY-mm-dd HH:ii'}} &nbsp;浏览: {{article.click}} &nbsp;作者: {{article.writer}} &nbsp;来源: <a href="{{article.source_url || url(':article', {id: article.id})}}">{{article.source}}</a></p>
        </div>
{{/block}}

{{block 'content'}}
<div class="container row">
    <main class="main">
        <article class="content">
            {{@article.content}}
            <p>
                关键词：{{each keywords_list item}}<span class="keywords_item">{{item}}</span>{{/each}}<br>
                所属分类：<a href="{{url(':cate', {cate: cate.cate_dir})}}">{{cate.cate_name}}</a><br>
                本文地址：<a href="{{article_link}}">{{article_link}}</a>
            </p>
        </article>
        {{if related && related.length}}
        <hr class="m-hr" />
        <dl class="box related">
            <dt><h3 class="title">相关文章</h3></dt>
            <dd>
                <ul>{{each related item index}}{{if !index && item.thumb}}
                    <li><a class="image" href="{{url(':article', {id: item.id})}}"><img src="{{item.thumb}}"/><span>{{item.title}}</span></a></li>{{else}}
                    <li><a href="{{url(':article', {id: item.id})}}">{{item.title}}</a></li>{{/if}}{{/each}}
                </ul>
            </dd>
        </dl>
        {{/if}}
        <hr class="m-hr" />
        <ul class="prevnext">
            {{if prevOne}}<li>上一篇: <a href="{{url(':article', {id: prevOne.id})}}">{{prevOne.title}}</a></li>{{/if}}
            {{if nextOne}}<li>下一篇: <a href="{{url(':article', {id: nextOne.id})}}">{{nextOne.title}}</a></li>{{/if}}
        </ul>
        {{if is_comment}}
        <hr class="m-hr" />
        <div class="comment">
            <h3 class="title">评论</h3>
            <form class="comment-form" action="{{url('comment/post')}}">
                <input type="hidden" name="article_id" value="{{article.id}}" />
                <input type="hidden" name="pid" value="0" />
                <div class="comment-input">
                    <input class="input" type="text" name="uname" placeholder="昵称(必填)" />
                    <input class="input" type="email" name="email" placeholder="邮箱(必填)" />
                    <input class="input" type="url" name="url" placeholder="网址(选填)" />
                </div>
                <div class="comment-area">
                    <textarea class="input c-area" name="content" placeholder="写点什么吧"></textarea>
                </div>
                <div class="comment-button">
                    <span class="button submit">提交</span><span class="button danger cancel">取消回复</span>
                </div>
            </form>
            <div class="comment-list" data-url="{{url('comment/list', {id: article.id})}}">
                <div class="comment-item">
                    <div class="face" data-id="[id]" data-uname="[uname]">[face]<span>@</span></div>
                    <div class="comment-body">
                        <div class="comment-user"><a href="[url]" target="_blank">[uname]</a> &nbsp;<span>[add_time]</span></div>
                        <div class="comment-content">[content]</div>
                        [reply]
                    </div>
                </div>
            </div>
            <div class="comment-more">加载更多评论</div>
        </div>
        {{/if}}
    </main>
    {{include './aside.htm'}}
</div>
{{/block}}